Skip to content

fix: change workspaceFolders capability to boolean for LSP servers#1929

Merged
tanzhenxin merged 1 commit intoQwenLM:mainfrom
TheForgivenOne:fix/gopls-workspaceFolders-capability
Feb 27, 2026
Merged

fix: change workspaceFolders capability to boolean for LSP servers#1929
tanzhenxin merged 1 commit intoQwenLM:mainfrom
TheForgivenOne:fix/gopls-workspaceFolders-capability

Conversation

@TheForgivenOne
Copy link
Copy Markdown
Contributor

@TheForgivenOne TheForgivenOne commented Feb 24, 2026

TLDR

Fixes #1748 - gopls failed to start with JSON RPC parse error. Changed the workspaceFolders capability from object { supported: true } to boolean true in initialize params, as gopls expects a boolean per the LSP spec.

Dive Deeper

The LSP spec defines workspaceFolders as a boolean capability, not an object. gopls was rejecting the initialize request because it expected a boolean but received an object.

Reviewer Test Plan

  1. Pull the branch
  2. Run npm install && npm run build
  3. Configure gopls as an LSP server in a Go project
  4. Use the LSP documentSymbol tool - should work without errors

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Fixes #1748

Fixes #1748 - gopls failed to start with JSON RPC parse error.
The workspaceFolders capability was incorrectly sent as an object
{ supported: true } instead of a boolean true, causing gopls to
fail with 'cannot unmarshal object into... bool'.
@yiliang114
Copy link
Copy Markdown
Collaborator

@TheForgivenOne Thanks for the fix!

Copy link
Copy Markdown
Collaborator

@yiliang114 yiliang114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tanzhenxin tanzhenxin merged commit ac5a0c6 into QwenLM:main Feb 27, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gopls failed to start

3 participants